<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>绝对定位(3)</title>
    <style>
        .father{
            width: 400px;
            height: 400px;
            background-color: gray;
            position: relative;
        }
        .son{
            width: 100px;
            height: 100px;
            background-color: black;
            position: absolute;
            top: 200px;
            left: 200px;
        }
        .son1{
            width: 100px;
            height: 100px;
            background-color: red;
        }
    </style>
</head>
<body>
    <!-- 绝对定位会脱标 -->
    <div class="father">
        <div class="son"></div>
        <div class="son1"></div>
    </div>
</body>
</html>